#ifndef __SYS_H
#define __SYS_H

#include "STC15F2K60S2.h"
#include "intrins.h"
#include "dsp.h"

#define COM(X)  {P0 = X; P2 = (P2 & 0x1F | 0xC0);  P2 &= 0x1F;}
#define SEG(X)  {P0 = X; P2 = (P2 & 0x1F | 0xE0);  P2 &= 0x1F;}
#define BUZ(X)  {P0 = X; P2 = (P2 & 0x1F | 0xA0);  P2 &= 0x1F;}
#define LED(X)  {P0 = X; P2 = (P2 & 0x1F | 0x80);  P2 &= 0x1F;}

void CloseAllPeripheral(void);
void OpenAllPeripheral(void);
void Delay100Ms(void);
void Delay10Ms(void);
void InitTimer2(void);

#endif